package cn.org.qary.service.impl.abelianymph;

import cn.org.qary.dao.ICartRecordMapper;
import cn.org.qary.entity.CartRecord;
import cn.org.qary.service.impl.BaseServiceImpl;
import cn.org.qary.service.trait.abelianymph.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CartServiceImpl extends BaseServiceImpl<CartRecord> implements CartService {

    @Autowired
    ICartRecordMapper cartRecordMapper;

    @Override
    public boolean productIsExist(Integer userId, Integer productId) {
        return cartRecordMapper.selectByUserIdAndProductId(userId, productId) != null;
    }

     public CartRecord selectByCombineId(Integer userId, Integer productId) {
        return cartRecordMapper.selectByUserIdAndProductId(userId, productId);
    }
}
